<?php
use yii\helpers\Html;
use yii\bootstrap\ActiveForm;

/* @var $this yii\web\View */
/* @var $model common\modules\content\models\Page */
/* @var $form yii\bootstrap\ActiveForm */
?>

<div class="page-form">

    <?php $form = ActiveForm::begin(); ?>

    <?= $form->field($model, 'title')->textInput(['maxlength' => true])?>

    <?= $form->field($model, 'slug')->textInput(['maxlength' => true])?>

    <?= $form->field($model, 'body')->widget(\yii\imperavi\Widget::className(), [
        'plugins' => [
            'fullscreen',
            'fontcolor',
            'video'
        ],
        'options' => [
            'minHeight' => 400,
            'maxHeight' => 400,
            'buttonSource' => true,
            'imageUpload' => Yii::$app->urlManager->createUrl([
                '/file-storage/upload-imperavi'
            ])
        ]
    ])?>

    <?= $form->field($model, 'view')->textInput(['maxlength' => true])?>

    <?= $form->field($model, 'status')->checkbox()?>

    <div class="form-group">
        <?= Html::submitButton($model->isNewRecord ? Yii::t('backend', 'Create') : Yii::t('backend', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary'])?>
    </div>

    <?php ActiveForm::end(); ?>

</div>
